#ifndef SR_H
#define SR_H

#include <SPI.h>
#include "stdint.h"
#include "stdbool.h"

#define Z5900M_Pin_Define

#define HV_CLK          21
#define HV_DIN          19
#define HV_LE           22

#ifdef  Z5900M_Pin_Define

#define n1_0    27
#define n1_1    28
#define n1_2    30
#define n1_3    24
#define n1_4    26
#define n1_5    23
#define n1_6    25
#define n1_7    22
#define n1_8    29
#define n1_9    31
#define n1_r    21
#define n1_l    20
#define led1    0

#define n2_0    4
#define n2_1    5
#define n2_2    7
#define n2_3    1
#define n2_4    3
#define n2_5    10
#define n2_6    2
#define n2_7    9
#define n2_8    6
#define n2_9    8
#define n2_r    12
#define n2_l    11
#define led2    0

#endif

#ifdef  IN16_Pin_Define

#define n1_0    28
#define n1_1    30
#define n1_2    24
#define n1_3    29
#define n1_4    20
#define n1_5    22
#define n1_6    23
#define n1_7    31
#define n1_8    26
#define n1_9    27
#define n1_r    19
#define n1_l    25
#define led1    21

#define n2_0    2
#define n2_1    4
#define n2_2    12
#define n2_3    6
#define n2_4    8
#define n2_5    9
#define n2_6    10
#define n2_7    5
#define n2_8    3
#define n2_9    1
#define n2_r    7
#define n2_l    13
#define led2    11

#endif

#define Fresh_Delay_Time    70 / portTICK_PERIOD_MS

typedef struct
{
    uint8_t state;
}sr_type;
extern sr_type sr;

extern uint32_t u32srbuf;

void sr_init(void);
void sr_senddata(uint32_t u32srbuf);
void sr_display(uint8_t num, bool N2_LD, bool N2_RD, bool N1_LD, bool N1_RD);



#endif


